Skip to content

Allow enabling http for haproxy route backend#230

Merged
Thanhphan1147 merged 20 commits intomainfrom
allow_enabling_http_for_haproxy_route_backend
Nov 24, 2025
Merged

Allow enabling http for haproxy route backend#230
Thanhphan1147 merged 20 commits intomainfrom
allow_enabling_http_for_haproxy_route_backend

Conversation

@Thanhphan1147
Copy link
Collaborator

@Thanhphan1147 Thanhphan1147 commented Nov 12, 2025

Blocked until #225 is merged. Add a new allow_http attribute to allow disabling mandatory HTTPS redirection for backends. Add logic to build the required ACL and rendering logic in the j2 template.

Checklist

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for allowing HTTP traffic alongside HTTPS in the haproxy-route backend configuration. The main change introduces an allow_http attribute that disables mandatory HTTPS redirection for specific backends when enabled. Additionally, the PR includes a migration from tox.ini to tox.toml configuration format and various code style improvements.

  • Adds allow_http attribute to haproxy-route library to control HTTP/HTTPS redirection behavior
  • Implements ACL generation logic to conditionally allow HTTP traffic based on backend configuration
  • Updates HAProxy configuration template to use allow_http ACLs in redirect rules

Reviewed Changes

Copilot reviewed 38 out of 40 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
lib/charms/haproxy/v1/haproxy_route.py Adds allow_http parameter to RequirerApplicationData and HaproxyRouteRequirer with documentation
src/state/haproxy_route.py Implements allow_http_acls property to generate ACL rules from backend configurations
templates/haproxy_route.cfg.j2 Updates HTTP-to-HTTPS redirect rule to exclude allow_http ACLs
src/haproxy.py Passes allow_http_acls to template rendering context
tests/unit/test_haproxy_route.py Adds unit tests for allow_http functionality
tox.toml Migrates from tox.ini to tox.toml configuration format
pyproject.toml Updates project configuration for new tooling
Various test files Code style improvements (f-string conversions, formatting fixes)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Thanhphan1147 Thanhphan1147 force-pushed the allow_enabling_http_for_haproxy_route_backend branch from 705b4fd to 08fc285 Compare November 18, 2025 10:06
@Thanhphan1147 Thanhphan1147 merged commit 4a06734 into main Nov 24, 2025
32 checks passed
@Thanhphan1147 Thanhphan1147 deleted the allow_enabling_http_for_haproxy_route_backend branch November 24, 2025 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants